/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	RenderEntryView.cpp
*
*	Comments	-	See RenderEntryView.h
*
**************************************************************************************/
#include "../Include/RenderEntryView.h"
#include "../Include/Engine.h"
#include "../Include/GlobalGraphicsStrings.h"
#include "../Include/ParameterBinderMatrixRef.h"

namespace Pulse
{
	RenderEntryView::RenderEntryView( void )
		: m_pView( PSX_NULL ), m_pViewBinder( PSX_NULL )
	{
		SetStage( ERenderViewStage::UNKNOWN );

		ParameterSystem *pParamSys = Engine::GetInstance()->GetRenderer()->GetParameterSystem();
	
		ParameterMatrix *pParamView = pParamSys->GetMatrix( GFX_PARAM_CAM_VIEW );

		m_pViewBinder = new ParameterBinderMatrixRef( pParamView );
	}

	RenderEntryView::~RenderEntryView( void )
	{
		delete m_pViewBinder;
	}
	
	void RenderEntryView::Execute( GraphicsPipeline *pPipeline )
	{
		m_pViewBinder->BindValue();
	}

	void RenderEntryView::SetViewMatrix( const Matrix4x4 *pView )
	{
		m_pView = pView;
		m_pViewBinder->SetData( m_pView );
	}

}